import request from '@/commons/libraries/request'
export default {
  async gets (page, pageSize) {
    try {
      const ret = await request('/car/lottery/gets/', {
        page: page,
        pageSize: pageSize
      })
      return ret
    } catch (err) {
      return Promise.reject(new Error(`系统错误，请稍后再试！<br/>[${err.message}]`))
    }
  },
  async getCount () {
    try {
      const ret = await request('/car/lottery/getCount/', {})
      return ret
    } catch (err) {
      return Promise.reject(new Error(`系统错误，请稍后再试！<br/>[${err.message}]`))
    }
  },
  async remove (id) {
    try {
      const ret = await request('/car/lottery/remove', {
        id: id
      })
      return ret
    } catch (err) {
      return Promise.reject(new Error(`系统错误，请稍后再试！<br/>[${err.message}]`))
    }
  }
}
